﻿@model FreightSoft.Models.CUSTOMER_ORDER

@{
    FreightSoft.Models.Entities db = new FreightSoft.Models.Entities();
}

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Customer Order</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.ORDER_ID)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.ORDER_ID, new { @readonly="readonly", Value = db.CUSTOMER_ORDER.Max(p=>p.ORDER_ID)+1 })
            @Html.ValidationMessageFor(model => model.ORDER_ID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CUSTOMER_ID, "Customer")
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.CUSTOMER_ID,  new { @readonly="readonly", Value = "305128"})
            @Html.ValidationMessageFor(model => model.CUSTOMER_ID)
        </div>


        <div class="editor-label">
            @Html.LabelFor(model => model.PRIORITY)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PRIORITY)
            @Html.ValidationMessageFor(model => model.PRIORITY)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.WANTED_DELIVERY_DATE)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.WANTED_DELIVERY_DATE)
            @Html.ValidationMessageFor(model => model.WANTED_DELIVERY_DATE)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DELIVERY_ADDRESS)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DELIVERY_ADDRESS)
            @Html.ValidationMessageFor(model => model.DELIVERY_ADDRESS)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FORWARDER_ID, "Forwarder")
        </div>
        <div class="editor-field">
            @Html.DropDownList("FORWARDER_ID", String.Empty)
            @Html.ValidationMessageFor(model => model.FORWARDER_ID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SOURCE, "Source Port")
        </div>
        <div class="editor-field">
            @Html.DropDownList("SOURCE", String.Empty)
            @Html.ValidationMessageFor(model => model.SOURCE)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DESTINATION, "Destination Port")
        </div>
        <div class="editor-field">
            @Html.DropDownList("DESTINATION", String.Empty)
            @Html.ValidationMessageFor(model => model.DESTINATION)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
